import React from 'react'
import { Form, Select } from 'antd'
import PropTypes from 'prop-types'
import { DictionaryItem } from '@js/dictionary';
const { Item } = Form
const { Option } = Select

interface Props {
  dictionary: { [k: string]: DictionaryItem[] }
}

function Main ({ dictionary }: Props) {
  const caseAreaList = dictionary['案件区域分类'] || []
  return (
    <Item label='案件区域分类' name='party_area_tag'>
      <Select style={{ width: '100%' }} placeholder='请选择案件区域分类' mode='multiple' allowClear>
        {caseAreaList.map(li => (
          <Option key={li.title} value={li.title}>{li.title}</Option>
        ))}
      </Select>
    </Item>
  )
}

Main.propTypes = {
  dictionary: PropTypes.object
}

Main.defaultProps = {
  dictionary: {}
}

export default Main
